From: bors Date: Wed, 4 Apr 2018 16:28:33 +0000 (+0000) Subject: Auto merge of #5270 - djc:feature-requirements, r=Eh2406 X-Git-Tag: archive/raspbian/0.35.0-2+rpi1~3^2^2^2^2^2^2^2~22^2~1^2~99 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=75f77fc68113291b21b98941e3713d000ceaf880;p=cargo.git Auto merge of #5270 - djc:feature-requirements, r=Eh2406 Introduce FeatureValue type to represent features table values This is the next step towards #1286 (after #5258). The goal here is to have a central place in the code where feature strings are interpreted as (a) a feature, (b) a dependency or (c) a dependency/feature combo, and anchor that interpretation in the type system as an enum. I've spent quite a bit of effort avoiding extra string allocations, complicating the code a bit; notice in particular the use of `Cow` in `FeatureValue` variants, and the slight workaround in `Context::resolve_features()` and `build_requirements()`. I hope this is all okay. cc @Eh2406 --- 75f77fc68113291b21b98941e3713d000ceaf880